home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 705 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. From: jdmorris@ix.netcom.com (Jason D. Morris)
  2. Message-ID: <31475017.8100207@nntp.ix.netcom.com>
  3. X-Original-Date: Wed, 13 Mar 1996 22:50:05 GMT
  4. Path: in2.uu.net!bounce-back
  5. Date: 13 Mar 96 23:50:08 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Exception handling -- was a finally block ever considered?
  9. Organization: Netcom
  10. X-Netcom-Date: Wed Mar 13  2:49:19 PM PST 1996
  11. X-Newsreader: Forte Agent .99d/32.182
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBFAgUBMUdfSeEDnX0m9pzZAQEK/gGAnltiXyladXrZ0BA7OagbEpMxnQQ61jiW
  14.     KWJtIeKpcRgOUroox9CUIQrazxVcRBVT
  15.     =VVFe
  16.  
  17. I would like to know if the following construct was ever considered by
  18. the C++ and if it was, why it was rejected.
  19.  
  20. try
  21. {
  22.     // some code that could generate an exception...
  23. }
  24. catch ( // some expected exception type )
  25. {
  26.     // handler code
  27. }
  28. finally
  29. {
  30.     // code that would be guaranteed to execute no matter how the 
  31.     // function was exited.
  32. }
  33.  
  34. Basically, a Java style finally clause.  I also found it interesting
  35. that Microsoft's structured exception handling under Win32 includes a
  36. finally clause.
  37.  
  38. Jason
  39. ---
  40. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  41. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  42. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  43. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  44. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  45.